package com.xpsoft.oa.dao.project.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.project.DesignChangeInfoDao;
import com.xpsoft.oa.model.project.DesignChangeInfo;

public class DesignChangeInfoDaoImpl extends BaseDaoImpl<DesignChangeInfo> implements DesignChangeInfoDao{

	public DesignChangeInfoDaoImpl() {
		super(DesignChangeInfo.class);
	}

	@Override
	public void deleteDesignChangeInfos(Long designChangeId, List<Long> idList) {
		String hql = "delete from DesignChangeInfo where id not in (:ids) and designChange.id=:designChangeId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("designChangeId", designChangeId);
		query.executeUpdate();
	}

}